#if !defined(AFX_CHARVIEW_H__F652C06A_6418_429A_8BFA_FA90280B0925__INCLUDED_)
#define AFX_CHARVIEW_H__F652C06A_6418_429A_8BFA_FA90280B0925__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CharView.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CCharView window

class CCharView : public CWnd
{
// Construction
public:
	CCharView();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCharView)
	//}}AFX_VIRTUAL

// Implementation
public:
	CPoint m_ptHover;
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	void SetChars(LPCTSTR lpszChars);
	virtual ~CCharView();

	// Generated message map functions
protected:
	void SetGridSize(int nGridSize);
	int m_nGridSize;
	void ClickGrid(CPoint pt);
	BOOL m_bFlag;
	BOOL IsGridDummy(const CPoint &ptGrid)
	{
		return (ptGrid.x == -1);
	}
	void RedrawGrid(int nRow, int nCol);
	void RedrawGrid(const CPoint &ptGrid)
	{
		RedrawGrid(ptGrid.y, ptGrid.x);
	}
	BOOL m_bDowned;
	CPoint m_ptLastClicked;
	void HighLightGrid(int nRow, int nCol);
	void DoScroll(int fnBar, UINT nSBCode, UINT nPos);
	void OnPrepareDC (CDC* pDC, CPrintInfo* pInfo = NULL);
	void ClearCharsArray();
	int m_nCellWidth;
	int m_nCellHeight;
	void UpdateCharsArray();
	BOOL m_bWordWrap;
	CString m_sChars;
	CArray<BSTR, BSTR> m_absChars;
	int m_nRowCount;
	int m_nColCount;
	int m_nFontPoint;

	void UpdateScrollSize();

	//{{AFX_MSG(CCharView)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnPaint();
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CHARVIEW_H__F652C06A_6418_429A_8BFA_FA90280B0925__INCLUDED_)
